//    注册  页面的异步请求
import request from './index'

// 获取 检测手机号码是否已经注册
export function validatePhoneRegister(phone) {
  return request({
    method: "GET",
    url: '/cellphone/existence/check',
    params: {
      phone
    }
  })
}
// 获取 验证码
export function getCaptcha(phone) {
  return request({
    method: "GET",
    url: '/captcha/sent',
    params: {
      phone
    }
  })
}

// 验证验证码
export function verifyCaptcha(queryInfo) {
  // queryInfo:{ phone,captcha }
  return request({
    method: "GET",
    url: '/captcha/verify',
    params: {
      ...queryInfo
    }
  })
}

// 注册
export function registerUser(queryInfo) {
  return request({
    method: "GET",
    url: "/register/cellphone",
    params: {
      ...queryInfo
    }
  })
}